<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<title>My JSP 'perfor_personal.jsp' starting page</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<link rel="stylesheet" type="text/css" href="css/table.css">
<script language="javascript" type="text/javascript"
	src="My97DatePicker/WdatePicker.js"></script>
</head>

<body>
	<form action="admin/perfor_personal_history.jsp" method="post"
		name="search">
		<table>
			<caption>按条件查询</caption>
			<tr>
				<td>月份</td>
				<td><input name="performance_month"
					onclick="WdatePicker({dateFmt:'yyyy-MM'})" type="text" /></td>
				<td><input type="submit" value="提交"></td>
		</table>
	</form>
	<c:if test="${param.performance_month!=null }">
		<sql:query var="result">
			select performance_emp_name,performance_date,performance_treat_type,performance_treat_amount,performance_reason from t_performance where date_format(performance_date,'%Y-%m')=? and performance_emp_id=${sessionScope.employee.emp_id}
			<sql:param value="${param.performance_month}" />
		</sql:query>
		<table>
			<caption>部门信息</caption>
			<thead>
				<tr>
					<th>姓名</th>
					<th>时间</th>
					<th>类型</th>
					<th>数目</th>
					<th>原因</th>
				</tr>
			</thead>
			<tbody id="tab">
				<c:forEach var="row" items="${result.rowsByIndex}">
					<tr>
						<c:forEach var="column" items="${row}">
							<td><c:out value="${column}" />
							</td>
						</c:forEach>

					</tr>
				</c:forEach>
			</tbody>
		</table>
		<script type="text/javascript">
		<!--
			var Ptr = document.getElementById("tab").getElementsByTagName("tr");
			function $() {
				for (i = 1; i < Ptr.length + 1; i++) {
					Ptr[i - 1].style.backgroundColor = (i % 2 > 0) ? "#fff"
							: "#eee";
				}
			}
			window.onload = $;
			for ( var i = 0; i < Ptr.length; i++) {
				Ptr[i].onmouseover = function() {
					this.tmpClass = this.className;
					this.style.backgroundColor = "#ccc";

				};
				Ptr[i].onmouseout = function() {
					for (i = 1; i < Ptr.length + 1; i++) {
						Ptr[i - 1].style.backgroundColor = (i % 2 > 0) ? "#eee"
								: "#fff";
					}
				}
			}
		//-->
		</script>
	</c:if>

</body>
</html>
